<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\ImagesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '图片管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="images-index">

<!--    <h1>--><?//= Html::encode($this->title) ?><!--</h1>-->
<!--    --><?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('上传新图', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'user_id',
//            'type',
            [
                'attribute' => 'typeName',
                'label'=>'类型',
                'value'=>'type0.type_name',
            ],
//            'url',
            'img_name',
//            'create_time:datetime',
            ['attribute'=>'create_time',
                'format'=>['date','php:Y-m-d H:i:s'],

            ],
             'Porright',
             'address',
             'info',
             'collectnum',

            [
                'class' => 'yii\grid\ActionColumn',
                'header' => '操作',
                'headerOptions' => ['width' => '200'],

            ],
        ],
    ]); ?>

</div>
